Fully Qualified Name: | Laminas\Session\Storage\SessionStorage |
Extends: | ArrayStorage |
Session storage in $_SESSION
Replaces the $_SESSION superglobal with an ArrayObject that allows for property access, metadata storage, locking, and immutability.
Name | Description | Defined By |
---|---|---|
__construct() | Constructor | SessionStorage |
__destruct() | Destructor | SessionStorage |
__get() | Returns the value at the specified key by reference | ArrayObject |
__isset() | Returns whether the requested key exists | ArrayObject |
__set() | Sets the value at the specified key to value | ArrayObject |
__unset() | Unsets the value at the specified key | ArrayObject |
append() | Appends the value | ArrayObject |
asort() | Sort the entries by value | ArrayObject |
clear() | Clear the storage object or a subkey of the object | ArrayStorage |
count() | Get the number of public properties in the ArrayObject | ArrayObject |
exchangeArray() | Exchange the array for another one. | ArrayObject |
fromArray() | Load session object from an existing array | SessionStorage |
getArrayCopy() | Creates a copy of the ArrayObject. | ArrayObject |
getFlags() | Gets the behavior flags. | ArrayObject |
getIterator() | Create a new iterator from an ArrayObject instance | ArrayObject |
getIteratorClass() | Gets the iterator classname for the ArrayObject. | ArrayObject |
getMetadata() | Retrieve metadata for the storage object or a specific metadata key | ArrayStorage |
getRequestAccessTime() | Retrieve the request access time | ArrayStorage |
isImmutable() | Determine if this object is isImmutable | SessionStorage |
isLocked() | Is the object or key marked as locked? | ArrayStorage |
ksort() | Sort the entries by key | ArrayObject |
lock() | Lock this storage instance, or a key within it | ArrayStorage |
markImmutable() | Mark object as isImmutable | SessionStorage |
natcasesort() | Sort an array using a case insensitive "natural order" algorithm | ArrayObject |
natsort() | Sort entries using a "natural order" algorithm | ArrayObject |
offsetExists() | Returns whether the requested key exists | ArrayObject |
offsetGet() | Returns the value at the specified key | ArrayObject |
offsetSet() | ArrayStorage | |
offsetUnset() | Unsets the value at the specified key | ArrayObject |
serialize() | Serialize an ArrayObject | ArrayObject |
setFlags() | Sets the behavior flags | ArrayObject |
setIteratorClass() | Sets the iterator classname for the ArrayObject | ArrayObject |
setMetadata() | Set storage metadata | ArrayStorage |
toArray() | Cast the object to an array | ArrayStorage |
uasort() | Sort the entries with a user-defined comparison function and maintain key association | ArrayObject |
uksort() | Sort the entries by keys using a user-defined comparison function | ArrayObject |
unlock() | Unlock an object or key marked as locked | ArrayStorage |
unserialize() | Unserialize an ArrayObject | ArrayObject |
Constructor
Sets the $_SESSION superglobal to an ArrayObject, maintaining previous values if any discovered.
Parameter Name | Type | Description |
---|---|---|
$input | array|null | |
$flags | int | |
$iteratorClass | string |
Returns:
Destructor
Resets $_SESSION superglobal to an array, by casting object using getArrayCopy().
Returns: void
Returns the value at the specified key by reference
Parameter Name | Type | Description |
---|---|---|
$key | mixed |
Returns: mixed
Returns whether the requested key exists
Parameter Name | Type | Description |
---|---|---|
$key | mixed |
Returns: bool
Sets the value at the specified key to value
Parameter Name | Type | Description |
---|---|---|
$key | mixed | |
$value | mixed |
Returns: void
Unsets the value at the specified key
Parameter Name | Type | Description |
---|---|---|
$key | mixed |
Returns: void
Appends the value
Parameter Name | Type | Description |
---|---|---|
$value | mixed |
Returns: void
Sort the entries by value
Returns: void
Clear the storage object or a subkey of the object
Parameter Name | Type | Description |
---|---|---|
$key | null|int|string |
Returns: \ArrayStorage
Get the number of public properties in the ArrayObject
Returns: int
Exchange the array for another one.
Parameter Name | Type | Description |
---|---|---|
$data | array|\ArrayObject |
Returns: array
Load session object from an existing array
Ensures $_SESSION is set to an instance of the object when complete.
Parameter Name | Type | Description |
---|---|---|
$array | array |
Returns: \SessionStorage
Creates a copy of the ArrayObject.
Returns: array
Gets the behavior flags.
Returns: int
Create a new iterator from an ArrayObject instance
Returns: \Iterator
Gets the iterator classname for the ArrayObject.
Returns: string
Retrieve metadata for the storage object or a specific metadata key
Returns false if no metadata stored, or no metadata exists for the given key.
Parameter Name | Type | Description |
---|---|---|
$key | null|int|string |
Returns: mixed
Retrieve the request access time
Returns: float
Determine if this object is isImmutable
Returns: bool
Is the object or key marked as locked?
Parameter Name | Type | Description |
---|---|---|
$key | null|int|string |
Returns: bool
Sort the entries by key
Returns: void
Lock this storage instance, or a key within it
Parameter Name | Type | Description |
---|---|---|
$key | null|int|string |
Returns: \ArrayStorage
Mark object as isImmutable
Returns: \SessionStorage
Sort an array using a case insensitive "natural order" algorithm
Returns: void
Sort entries using a "natural order" algorithm
Returns: void
Returns whether the requested key exists
Parameter Name | Type | Description |
---|---|---|
$key | mixed |
Returns: bool
Returns the value at the specified key
Parameter Name | Type | Description |
---|---|---|
$key | mixed |
Returns: mixed
Parameter Name | Type | Description |
---|---|---|
$key | mixed | |
$value | mixed |
Returns:
Unsets the value at the specified key
Parameter Name | Type | Description |
---|---|---|
$key | mixed |
Returns: void
Serialize an ArrayObject
Returns: string
Sets the behavior flags
Parameter Name | Type | Description |
---|---|---|
$flags | int |
Returns: void
Sets the iterator classname for the ArrayObject
Parameter Name | Type | Description |
---|---|---|
$class | string |
Returns: void
Set storage metadata
Metadata is used to store information about the data being stored in the object. Some example use cases include:
Parameter Name | Type | Description |
---|---|---|
$key | string | |
$value | mixed | |
$overwriteArray | bool | Whether |
Returns: \ArrayStorage
Cast the object to an array
Parameter Name | Type | Description |
---|---|---|
$metaData | bool | Whether |
Returns: array
Sort the entries with a user-defined comparison function and maintain key association
Parameter Name | Type | Description |
---|---|---|
$function | callable |
Returns: void
Sort the entries by keys using a user-defined comparison function
Parameter Name | Type | Description |
---|---|---|
$function | callable |
Returns: void
Unlock an object or key marked as locked
Parameter Name | Type | Description |
---|---|---|
$key | null|int|string |
Returns: \ArrayStorage
Unserialize an ArrayObject
Parameter Name | Type | Description |
---|---|---|
$data | string |
Returns: void